home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winsock / ircii2-6.zip / SRC\IRCII-2.6\SCRIPT\TABKEY < prev    next >
Text File  |  1995-01-02  |  3KB  |  94 lines

  1. #------------------------------------------------------------------------------#
  2. # updated for 2.2.2
  3. # This keeps track of the nicks of people you MSG.  You can then
  4. # just hit the tab key ^I to flip through the list of people
  5. # you sent MSGs to.  
  6. # Assign tk.msgmax to the number of nicknames you wish to store
  7. # Modified by Chetnik (s902211@yallara.cs.rmit.oz.au)
  8. #         and Daemon  (frechett@spot.colorado.edu)
  9. # It will now keep unique nicknames in the list ordered from the most recent
  10. # message received or sent to the oldest message received or sent.
  11. # Ctrl R will flip thru the list backwards (Reverse).
  12. # Crtl-X Ctrl-X deletes the currently displayed or current nick from the list.
  13. # /addnick <nickname list>    will add the nicknames to the list.
  14. # /nicklist             will show the current list of names
  15. # If a nickname which has 'never' existed is messaged, it will not be added to
  16. # the list.
  17.  
  18. # searches thru list forwards (tab) or backwards (ctrl R)
  19. bind ^I parse_command ^tk.getmsg 1 $tk.msglist
  20. bind ^R parse_command ^tk.getmsg -1 $tk.msglist
  21. # Delete current nickname or currently displayed nickname from list
  22. bind ^X^X parse_command tk.delnick
  23. # shows all the current nicknames in the list.
  24. alias nicklist echo *** Nickname List: $tk.msglist
  25. # Adds nicknames to the list.. 
  26. alias addnick if ([$1]) { addnick $1- };tk.addmsg $0 $tk.msglist
  27. # Set this to the max number of nickname you want on the list at a time
  28. @ tk.msgmax = 10
  29.  
  30. # From here down are internal aliases and 'ON's.
  31. # This script uses SERIAL NUMBER  #55
  32. # keeps list of unique nicks from newest message to oldest message.
  33. alias tk.addmsg {
  34.     @ tk.matched = rmatch($0 $^\1-)
  35.     if (tk.matched)
  36.     {
  37.         @ tk.msglist = [$(0-${tk.matched-1}) $(${tk.matched+1}-)]
  38.     }
  39.     #else
  40.     {    @ tk.msglist = [$(0-${tk.msgmax-1})] }
  41.     @ tk.msgcnt = 0
  42.     ^assign -tk.matched
  43. }
  44. # searches thru list forwards or backwards. ($0==1==forward),($0==-1==back)
  45. alias tk.getmsg {
  46.     @ tk.msgcnt = tk.msgcnt + [$0]
  47.     if ( #tk.msglist < tk.msgcnt ) {@ tk.msgcnt = 1}
  48.     if (tk.msgcnt <= 0) {@ tk.msgcnt =  #tk.msglist}
  49.     @ tk.junk = K ## [msg]
  50.     xtype -replace $tk.junk $^^{[$($tk.msgcnt)]} 
  51. }
  52. # some initialisation.  You can comment these out if you want to.
  53. # ^on #-401 55 * if ([$AUTO_WHOWAS] != [ON]) { ^whowas $1 }
  54. # ^on ^406 * {
  55. #    ^assign tk.msglist $notword($rmatch($1 $tk.msglist) $tk.msglist)
  56. #    if ([$AUTO_WHOWAS] == [ON]) { echo *** $1- }
  57. #}
  58.     
  59.  
  60. # Adds nick to list when message is sent or received. Doesn't effect output.
  61. on #-send_msg 55 * ^tk.addmsg $0 $tk.msglist
  62. on #-msg 55 * ^tk.addmsg $0 $tk.msglist
  63. on #-send_dcc_chat 55 * ^tk.addmsg \=$0 $tk.msglist
  64. on #-dcc_chat 55 * ^tk.addmsg \=$0 $tk.msglist
  65.  
  66. # deletes current nick from list
  67. alias tk.delnick {
  68.     if (tk.msgcnt == 0)
  69.     {
  70.         echo *** Nickname: $word(0 $tk.msglist) removed.
  71.         @ tk.msglist = [$notword(1 $tk.msglist)]
  72.     }
  73.     {
  74.         echo *** Nickname: $word(${tk.msgcnt-1} $tk.msglist) removed.
  75.         @ tk.msglist = [$notword($tk.msgcnt $tk.msglist)]
  76.     }
  77.     type ^U
  78. }
  79. # The $notword() function.  
  80. alias notword {
  81.     if ([$0] > 0)
  82.     {
  83.     if (([$0] > 1) && ([$0] < rmatch($~ $1-)))
  84.         { @ nw.sep = [ ] }
  85.         { @ nw.sep = [] }
  86.         
  87.     @ function_return = [$(1-${[$0]-1})] ## [$nw.sep] ## [$(${[$0]+1}-)]
  88.     }
  89.     {
  90.         @ function_return = [$1-]
  91.     }
  92. }
  93. #------------------------------------------------------------------------------#
  94.